package api

import (
	"gitee.com/kristas/booting-go/framework"
	"gitee.com/kristas/booting-go/framework/core/statement/types"
	"gitee.com/kristas/booting-go/framework/web/resp"
	"gitee.com/kristas/booting-go/framework/web/rest"
	"gitee.com/kristas/booting-go/internal/demo/service"
)

func init() {
	framework.Component(new(IndexController))
}

type IndexController struct {
	types.Controller `name:"IndexController" group:""`
	service.Factory  `wire:"service_factory"`
	index            rest.GET `url:"/apis"` //使用API类型定义路由，TAG定义接口路径和参数类型，实现方法约定为 Handle+字段名称(参数)
}

func (r *IndexController) Index() resp.Response { //使用Html类型返回值，则将文本作为html页面类型
	return r.GetRouteService().Apis()
}
